<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>农产品质量安全追溯系统 - 首页</title>
<link rel="stylesheet" href="${path }/cms/css/public.css"/>
<link rel="stylesheet" href="${path }/cms/css/index.css"/>
<script type="text/javascript" src="${path}/cms/js/jquery-1.8.3.min.js"></script>
</head>
<body>
<%@ include file="/WEB-INF/cms/header.jsp" %>

<div class="productInquire">
    <div>
        <img src="${path }/cms/images/cp1.png" alt="">
    </div>
    <div>
        <img src="${path }/cms/images/cp2.png" alt="">
    </div>
    <div>
        <input type="text" id="querycode" placeholder="请输入产品追溯码">
        <p>商品条码，例：6901267867891</p>
        <a href="javascript:;" onclick="doQuery()">
        	<img src="${path }/cms/images/cp5.png" alt="">
        </a>
    </div>
    <div>
        <a href="javascript:;" onclick="doQuery()">
	        <div>点击查询</div>
	        <img src="${path }/cms/images/cp4.png" alt="点击查询" />
	    </a>
    </div>
</div>

<script type="text/javascript">
function doQuery(){
	location.href = '${path}/c/traceQuery.do?code='+$('#querycode').val();
}
</script>

<div class="btBox">
    <h2>合作企业</h2>
    <p>Cooperative enterprise</p>
</div>
<div class="imgfontList" id="qiyelist">
</div>
<div class="lrTEHp">
    <div>
        <div class="lirTEhpTop">
            <div></div>
            <h2>质量措施</h2>
            <a href="${path }/c/zlcs.do" target="_blank">
            	<span>More&nbsp;&gt;&gt;</span>
            </a>
        </div>
        <div class="lirTEhpContent" id="zlcslist0">
        </div>
        <div class="lirTEhpBottom" id="zlcslist1">
        </div>
    </div>
    <div>
        <div class="lirTEhpTop">
            <div></div>
            <h2>农业概况</h2>
            <a href="${path }/c/nygk.do" target="_blank">
            	<span>More&nbsp;&gt;&gt;</span>
            </a>
        </div>
        <div class="lirTEhpContent" id="nygklist0">
        </div>
        <div class="lirTEhpBottom" id="nygklist1">
        </div>
    </div>
</div>
<div class="btBox">
    <h2>特色园区</h2>
    <p>Characteristic park</p>
</div>
<div class="eitImgBox" id="parklist">
</div>

<div class="btBox">
    <h2>名优产品</h2>
    <p>Famous Quality Products</p>
</div>
<div class="fourImgTextBox" id="productlist">
</div>

<%@ include file="/WEB-INF/cms/footer.jsp" %>
<script type="text/javascript">
$(function(){
	$.get('${path}/c/getIndexQiye.json', function(list){
		var qiyelist = $('#qiyelist');
		$.each(list, function(i, d){
			var remark = d.remark;
			if(remark.length > 60){
				remark = remark.substring(0, 60)+"...";
			}
			qiyelist.append('<div> <div class="hoverScale">'
					+' <a href="${path}/c/qiyeDetail.do?id='+d.companyid+'" target="_blank"> <img src="'+d.imgurl+'" alt="" onerror="this.src=\'${path}/cms/def/qiye.png\'"/> </a> </div>'
					+' <div> <a href="${path}/c/qiyeDetail.do?id='+d.companyid+'" target="_blank"> <h3>'+d.companyName+'</h3> </a> <p>'+remark+'</p> </div> </div> ');
		});
	});
	$.get('${path}/c/getIndexArticle.json?type=zlcs', function(list){
		var zlcslist1 = $('#zlcslist1');
		$.each(list, function(i, d){
			if(i==0){
				var articleDesc = d.articleDesc;
				if(articleDesc.length > 70){
					articleDesc = articleDesc.substring(0, 70)+"...";
				}
				$('#zlcslist0').html('<div> <a href="${path}/c/detail.do?id='+d.articleId+'" target="_blank"> <img src="'+d.thumb+'" alt="" onerror="this.src=\'${path}/cms/def/news.png\'"/> </a> </div>'
						+' <div> <a href="${path}/c/detail.do?id='+d.articleId+'" target="_blank"> <h3>'+d.articleTitle+'</h3> </a> <p>'+articleDesc+'</p> </div> ');
			}else{
				zlcslist1.append('<div> <div></div> <a href="${path}/c/detail.do?id='+d.articleId+'" target="_blank"> <p>'+d.articleTitle+'</p> </a> </div> ');
			}
		});
	});
	$.get('${path}/c/getIndexArticle.json?type=nygk', function(list){
		var nygklist1 = $('#nygklist1');
		$.each(list, function(i, d){
			if(i==0){
				var articleDesc = d.articleDesc;
				if(articleDesc.length > 70){
					articleDesc = articleDesc.substring(0, 70)+"...";
				}
				$('#nygklist0').html('<div> <a href="${path}/c/detail.do?id='+d.articleId+'" target="_blank"> <img src="'+d.thumb+'" alt="" onerror="this.src=\'${path}/cms/def/news.png\'"/> </a> </div>'
						+' <div> <a href="${path}/c/detail.do?id='+d.articleId+'" target="_blank"> <h3>'+d.articleTitle+'</h3> </a> <p>'+articleDesc+'</p> </div> ');
			}else{
				nygklist1.append('<div> <div></div> <a href="${path}/c/detail.do?id='+d.articleId+'" target="_blank"> <p>'+d.articleTitle+'</p> </a> </div> ');
			}
		});
	});
	$.get('${path}/c/getIndexPark.json', function(list){
		var parklist = $('#parklist');
		$.each(list, function(i, d){
			parklist.append('<div> <a href="${path}/c/parkDetail.do?id='+d.parkid+'" target="_blank"> <div class="cdFloat">'+d.parkName+'</div> <img src="'+d.logoUrl+'" alt="" onerror="this.src=\'${path}/cms/def/park.png\'"/> </a> </div> ');
		});
	});
	$.get('${path}/c/getIndexProducts.json', function(list){
		var productlist = $('#productlist');
		$.each(list, function(i, d){
			var introduce = d.introduce;
			if(introduce.length > 70){
				introduce = introduce.substring(0, 70)+"...";
			}
			productlist.append('<div> <div> <a href="${path}/c/pdtDetail.do?id='+d.productid+'" target="_blank"> <img src="'+d.productImg+'" alt="" onerror="this.src=\'${path}/cms/def/pdt.png\'"/> </a> </div>'
					+' <div> <a href="${path}/c/pdtDetail.do?id='+d.productid+'" target="_blank"> <h3>'+d.productName+'</h3> </a>'
					+' <p>产地：'+d.parkName+'</p>'
					+' <p>'+introduce+'</p> </div> </div> ');
		});
	});
});
</script>

</body>
</html>